<?php
ini_set("soap.wsdl_cache_enabled","0");

$service  = new SoapClient("http://208.74.72.210:8080/EnticeWS/services/billing3?wsdl");

$key = 'pass';
$key = mkResllerKey($key);

//041565409351933
//$data = $service->getSubscriber('12',$key, '04128582369454235');
//acct_id = 283
//cust_id = 4128
$xml = '<?xml version="1.0" encoding="UTF-8"?>
 <EnticeRequest>
	<data>
		<row>
			<SUBSCRIBER_ID/>
			<ACCT_ID>288</ACCT_ID>
			<CUST_ID>4160</CUST_ID>
			
			<PIN />
			<BALANCE>600</BALANCE>
			<STATUS>1</STATUS>
			<ACT_DATE/>
			<TTL>720</TTL>
			<RESELLER_ID>12</RESELLER_ID>
			<ERR_COUNTER>0</ERR_COUNTER>
			<LIMIT>0</LIMIT>
			<PREPAID_CARD_SEQ/>
			<REMARK />
			<BILLED_DATE />
			<FEEPLAN_ID>101</FEEPLAN_ID>
			<USER_NAME>b</USER_NAME>
			<PASSWORD>1</PASSWORD>
			<ACCESS_CODE_ALWAYS>false</ACCESS_CODE_ALWAYS>
			<contact>
				<CONT_ID/>
				<LASTNAME>ANI</LASTNAME>
				<FIRSTNAME>First</FIRSTNAME>
				<TITLE />
				<PHONE_NUM />
				<FAX_NUM />
				<MOBILE_NUM />
				<EMAIL />
				<CONTACT_TYPE_ID>3</CONTACT_TYPE_ID>
				<COMPANY>Toplink</COMPANY>
			         <ADDRESS1>Algade 1</ADDRESS1>
			         <ADDRESS2>Lilleby</ADDRESS2>
			         <ADDRESS3/>
			         <CITY>Horsens</CITY>
			         <STATE/>
			         <POSTAL>8700</POSTAL>
				<COUNTRY/>
				<MISC />
				<MODIFIED_DATE/>
			</contact>
			<phone>
		         <PHONE_ID>0</PHONE_ID>
		         <MAC_ADDR>012345543212</MAC_ADDR>
		         <PHONE_TYPE>other</PHONE_TYPE>
		         <phoneline>
		           <LINE_ID>1</LINE_ID>
		           <EP_ALIAS>E_3990_5551114000</EP_ALIAS>
		           <EP_PIN>2344</EP_PIN>
		           <NUMBER type="DID" main="true" vmOfferingId="654" vmOfferingDesc="Voice Mail Service" mailbox="64641000">64641000</NUMBER>
		           <NUMBER type="DID" vmOfferingId="5481" mailbox="64641001">64641001</NUMBER>
		         </phoneline>
		       </phone>
		</row>
	</data>
</EnticeRequest>';

$data = $service->addSubscriber('12',$key,$xml);

//header('Content-type: text/xml');
var_dump($data);

function mkResllerKey($key)
{
	$dt = gmdate("m/d/Y", time());
	$key =substr($dt,0,6).$key.substr($dt, 5);
	return md5($key);
}